#chrome-volume-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: Arial, sans-serif;
  color: white;
  transition: none; /* 移除过渡效果，防止拖拽时的变形 */
  cursor: move;
  width: 40px; /* 固定宽度 */
  height: 40px; /* 固定高度 */
}

#volume-icon {
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#volume-icon:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

#volume-icon svg {
  transition: all 0.3s ease;
}

#volume-icon:hover svg {
  transform: scale(1.1);
}

#volume-panel {
  position: absolute;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  padding: 15px;
  color: white;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  margin: 0;
  z-index: 10000; /* 确保面板在最上层 */
}

#chrome-volume-control:hover #volume-panel,
#chrome-volume-control.dragging #volume-panel {
  opacity: 1;
  visibility: visible;
}

#volume-display {
  text-align: center;
  font-size: 18px;
  margin-bottom: 10px;
}

#volume-slider {
  width: 100%;
  -webkit-appearance: none;
  background: #ddd;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  border-radius: 5px;
  margin: 10px 0;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #4CAF50;
  cursor: pointer;
  border-radius: 50%;
  margin-top: -7px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

#volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #555;
  border-radius: 3px;
  cursor: pointer;
}

#volume-slider:focus {
  outline: none;
}

#volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #4CAF50;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

#volume-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

#volume-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  background: #555;
  border-radius: 3px;
  cursor: pointer;
}

/* 控制面板的初始样式 */
#volumePanel {
  display: none;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 显示控制面板时的动画效果 */
#volumePanel.show {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* 隐藏控制面板时的动画效果 */
#volumePanel.hide {
  opacity: 0;
  transform: scale(0.8);
}

#close-control {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 12px;
  cursor: pointer;
  color: #ccc;
  transition: color 0.3s ease;
}

#close-control:hover {
  color: #fff;
}

/* 拖动时的样式 */
#chrome-volume-control.dragging {
  opacity: 1;
}